import controllers.*;

import errors.*;

import models.*;

import mx.controls.Alert;

import views.*;

public var userManager:UserManager 			= new UserManager();
public var projectManager:ProjectManager 	= new ProjectManager();
public var diagramManager:DiagramManager 	= new DiagramManager();
public var umlClassManager:UMLClassManager	= new UMLClassManager();
public var umlAttributeManager:UMLAttributeManager	= new UMLAttributeManager();

private function init() : void {
	WindowManager.open(WindowManager.USER_LOGIN);
	HTTPController.wakeUpHandler = function (response:RESTResponse) : void {
		switch(WindowManager.main) {
			case WindowManager.PROJECT_LIST:
				projectManager.wakeUp();
			break;
			
			case WindowManager.DIAGRAM_EDIT:
				diagramManager.wakeUp();
				umlClassManager.wakeUp();
			break;
		}
	}; 
}

public function self() : Object {
	return this;
}